package cn.com.blueInfo.HaiYuan.business.purchase.controller;

import cn.com.blueInfo.HaiYuan.business.purchase.service.PurchaseVoucherService;
import cn.com.blueInfo.utils.result.BootstrapTable;
import cn.com.blueInfo.utils.result.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 采购单据管理
 * @ClassName: PurchaseVoucherController
 * @author suxch
 * @date 2019年4月24日  上午10:34:39
 */
@RestController
@RequestMapping("/operation/business/purchaseVoucher")
public class PurchaseVoucherController {

    @Autowired
    private PurchaseVoucherService voucherService;

    /**
     * 分页查询采购单信息
     * @Title: queryPurchaseVoucherInfoByPage
     * @param request
     * @return BootstrapTable
     * @throws
     */
    @RequestMapping("/queryPurchaseVoucherInfoByPage.do")
    public BootstrapTable queryPurchaseVoucherInfoByPage(HttpServletRequest request) {
        return voucherService.queryPurchaseVoucherDataByPage(request);
    }

    /**
     * 获取最大排序编号
     * @Title: getMaxOrderNumber
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/getMaxOrderNumber.do")
    public ResultInfo getMaxOrderNumber(HttpServletRequest request) {
        return voucherService.queryMaxOrderNumber(request);
    }

    /**
     * 新增采购单信息
     * @Title: addPurchaseVoucherInfo
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/addPurchaseVoucherInfo.do")
    public ResultInfo addPurchaseVoucherInfo(HttpServletRequest request) {
        return voucherService.addPurchaseVoucherData(request);
    }

    /**
     * 更新采购单信息
     * @Title: updatePurchaseVoucherInfo
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/updatePurchaseVoucherInfo.do")
    public ResultInfo updatePurchaseVoucherInfo(HttpServletRequest request) {
        return voucherService.updatePurchaseVoucherData(request);
    }

    /**
     * 删除采购单信息
     * @Title: deletePurchaseVoucherInfo
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/deletePurchaseVoucherInfo.do")
    public ResultInfo deletePurchaseVoucherInfo(HttpServletRequest request) {
        return voucherService.deletePurchaseVoucherData(request);
    }

}
